<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Dictionay</title>
  </head>
  <body>
    <script>
      class Dictionary {
        constructor() {
          this.items = {};
        }
        set(key, value) {
          this.items[key] = value;
        }
        has(key) {
          return this.items.hasOwnProperty(key);
        }
        remove(key) {
          if (!this.items.has(key)) return false;
          delete this.items[key];
          return true;
        }
        get(key) {
          return this.items.has(key) ? this.items[key] : undefined;
        }
        keys() {
          return Object.keys(this.items);
        }
        values() {
          return Object.values(this.items);
        }
        size() {
          return this.keys().length;
        }
        clear() {
          this.items = {};
        }
      }
    </script>
  </body>
</html>
